import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: '/',
    redirect: '/MainView',
    component: () => import('../layout/index.vue'),
    children: [
      {
        path: '/defect',
        name: 'defect',
        component: () => import('../layout/defect-info/index.vue')
      },
      {
        path: '/selfDefineCompute',
        name: 'selfDefineCompute',
        component: () => import('../layout/SubView/selfDefineCompute.vue')
      },
      {
        path: '/dataManage',
        name: 'dataManage',
        component: () => import('../layout/Datamanage/index.vue')
      },
      {
        path: '/dataReportExport',
        name: 'dataReportExport',
        component: () => import('../layout/DataReportExport/index.vue')
      }
    ]
  },
  {
    path: '/map',
    name: '/map',
    component: () => import('../components/ArcGisMap.vue')
  },
  {
    path: '/MainView',
    name: 'MainView',
    component: () => import('../layout/MainView')
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
